Skip to content

Add allow_ddm_traffic to port config in CRDB - #11117

Merged
andrewjstone merged 3 commits into
mainfrom
multirack-join-service-part-3.5
Aug 20, 2026
Merged

Add allow_ddm_traffic to port config in CRDB#11117
andrewjstone merged 3 commits into
mainfrom
multirack-join-service-part-3.5

Conversation

@andrewjstone

Copy link
Copy Markdown
Contributor

For multirack testing we need to be able to enable DDM traffic on a front port. We only want to expose this configuraton via RSS now, as the vast majority of multirack is not ready and we only want to do internal testing. We want to leave the external API untouched right now.

However, the sync_switch_configuration background task will immediately overwrite the value set in RSS, if we always hard code it to the default of false. Therefore, we had to add code to plumb the value into CRDB from RSS and apply it during the sync_switch_configuration background task.

Thanks to @jgallagher for pointing this out earlier.

Comment thread nexus/src/app/rack.rs
match self
.db_datastore
.switch_port_settings_create(opctx, &port_settings_params, None)
.switch_port_settings_create(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the value from RSS is actually stored in the DB.

Base automatically changed from multirack-join-service-part-3 to main August 20, 2026 06:05
For multirack testing we need to be able to enable DDM traffic on a
front port. We only want to expose this configuraton via RSS now, as
the vast majority of multirack is not ready and we only want to do internal
testing. We want to leave the external API untouched right now.

However, the `sync_switch_configuration` background task will
immediately overwrite the value set in RSS, if we always hard code it to
the default of false. Therefore, we had to add code to plumb the value
into CRDB from RSS and apply it during the `sync_switch_configuration`
background task.

Thanks to @jgallagher for [pointing this out earlier](#11091 (comment)).
@andrewjstone
andrewjstone force-pushed the multirack-join-service-part-3.5 branch from a323dbe to 115f4df Compare August 20, 2026 15:19

@jgallagher jgallagher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one nit on the schema and a question about the API

Comment thread schema/crdb/dbinit.sql Outdated
port_settings_id UUID PRIMARY KEY,
geometry omicron.public.switch_port_geometry
geometry omicron.public.switch_port_geometry,
allow_ddm_traffic BOOL NOT NULL DEFAULT false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the DEFAULT false? Every insert should provide a value here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Done in d3eb9c4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we generally set a default and then remove it in the next DDL in the migration.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, I messed this up. I need to account for the migration. Thanks @sunshowers. I'll fix it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I fixed this in fbcc5ce

Comment thread nexus/db-queries/src/db/datastore/switch_port.rs
Comment thread nexus/db-queries/src/db/datastore/switch_port.rs
Comment thread nexus/db-model/src/switch_port.rs
Comment thread schema/crdb/dbinit.sql Outdated
port_settings_id UUID PRIMARY KEY,
geometry omicron.public.switch_port_geometry
geometry omicron.public.switch_port_geometry,
allow_ddm_traffic BOOL NOT NULL DEFAULT false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we generally set a default and then remove it in the next DDL in the migration.

@andrewjstone
andrewjstone disabled auto-merge August 20, 2026 17:04
@andrewjstone
andrewjstone enabled auto-merge (squash) August 20, 2026 17:15
@andrewjstone
andrewjstone disabled auto-merge August 20, 2026 17:16
@andrewjstone
andrewjstone enabled auto-merge (squash) August 20, 2026 17:16
@andrewjstone
andrewjstone merged commit 3de7e90 into main Aug 20, 2026
19 checks passed
@andrewjstone
andrewjstone deleted the multirack-join-service-part-3.5 branch August 20, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants